Imports Iou = System.IO
Imports Sys = System

Namespace Enhancements.Core.Logging
    ''' <summary>A type of configuration specific to FileSystemWriter instances, when a single output file is intended.</summary>
    <DebuggerStepThrough()> _
    Public NotInheritable Class FileSystemWriterConfigurationSingleFile
        Inherits FileSystemWriterConfiguration

        ''' <summary>Initializes a FileSystemWriterConfigurationSingleFile instance, with default values.</summary>
        Public Sub New()
        End Sub
        ''' <summary>Initializes a FileSystemWriterConfigurationSingleFile instance, with some default values and others supplied.</summary>
        ''' <param name="_file">File to use by the instance.</param>
        ''' <exception cref="IsNullException">_file is null.</exception>
        ''' <exception cref="IsPathPartValidNotException">_file is invalid.</exception>
        ''' <exception cref="IsInNotException">_file does not contain the name/extension separator.</exception>
        Public Sub New(ByVal _file As System.String)
            File = _file
        End Sub
        ''' <summary>Initializes a FileSystemWriterConfigurationSingleFile instance.</summary>
        ''' <param name="_file">File to use by the instance.</param>
        ''' <param name="_folder">Folder to use by the instance.</param>
        ''' <param name="_deleteOnStartup">DeleteOnStartup to use by the instance.</param>
        ''' <exception cref="IsNullException">_file is null, or _folder is null.</exception>
        ''' <exception cref="IsPathPartValidNotException">_file is invalid.</exception>
        ''' <exception cref="IsInNotException">_file does not contain the name/extension separator.</exception>
        ''' <exception cref="IsPathValidNotException">_folder is invalid.</exception>
        Public Sub New(ByVal _file As System.String, ByVal _folder As System.String, ByVal _deleteOnStartup As System.Boolean)
            MyBase.New(_folder, _deleteOnStartup)
            File = _file
        End Sub

        Private __File As System.String = "Enhancements.Core.Logging.File.xml"
        ''' <summary>Gets the file used by the instance. The default value is 'Enhancements.Core.Logging.File.xml'.</summary>
        ''' <exception cref="IsNullException">The value is null (while setting).</exception>
        ''' <exception cref="IsPathPartValidNotException">The value is invalid (while setting).</exception>
        ''' <exception cref="IsInNotException">The value does not contain the name/extension separator (while setting).</exception>
        Public Property File() As System.String
            Get
                Return __File
            End Get
            Private Set(ByVal _value As System.String)
                ___Assert.___IsNullNot("File._value", _value, True)
                ___Assert.___IsPathPartValid("File._value", _value, True)
                ___Assert.___IsIn("File._value", _value, "."c, True)

                __File = _value
            End Set
        End Property

    End Class
End Namespace
